<html>
<head><meta charset="utf-8"><title>Documentation of order of Option &amp; Result · new members · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/index.html">new members</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html">Documentation of order of Option &amp; Result</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="247688791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Documentation%20of%20order%20of%20Option%20%26%20Result/near/247688791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Anton Golov <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html#247688791">(Jul 30 2021 at 10:00)</a>:</h4>
<p>Hi, regarding this issue: <a href="https://github.com/rust-lang/rust/issues/87238">https://github.com/rust-lang/rust/issues/87238</a><br>
The suggestion in the issue is to manually reimplement Ord (or perhaps PartialOrd) for Option and Result to allow for more explicit documentation.  Would this be a desirable change?  The code duplication doesn't seem great.</p>



<a name="247689601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Documentation%20of%20order%20of%20Option%20%26%20Result/near/247689601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html#247689601">(Jul 30 2021 at 10:11)</a>:</h4>
<p>Sounds good. I don't think there would be that much duplication (in the long run), and documenting the order seems desirable.</p>



<a name="247689835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Documentation%20of%20order%20of%20Option%20%26%20Result/near/247689835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Anton Golov <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html#247689835">(Jul 30 2021 at 10:14)</a>:</h4>
<p><del>Thanks for the confirmation!  I'll go ahead and implement it.</del> (decided not to given it's not clear whether it's the right way to go or not, see issue)</p>



<a name="247689967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Documentation%20of%20order%20of%20Option%20%26%20Result/near/247689967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html#247689967">(Jul 30 2021 at 10:16)</a>:</h4>
<p>Well, don't take my word for it, I'm not a library developer. But it sounds reasonable given the discussion in there.</p>



<a name="247769415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Documentation%20of%20order%20of%20Option%20%26%20Result/near/247769415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eholk <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html#247769415">(Jul 30 2021 at 22:29)</a>:</h4>
<p>It seems like it wouldn't be too much code duplication, and the improved documentation sounds worth it to me. It probably doesn't hurt to put up a PR and then discuss it there to see whether it's worthwhile.</p>



<a name="247796708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Documentation%20of%20order%20of%20Option%20%26%20Result/near/247796708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Anton Golov <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Documentation.20of.20order.20of.20Option.20.26.20Result.html#247796708">(Jul 31 2021 at 10:04)</a>:</h4>
<p>Ah, alright, thanks :)  I've sent <a href="https://github.com/rust-lang/rust/pull/87654">https://github.com/rust-lang/rust/pull/87654</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>